load(
    "@rules_rust//rust:defs.bzl",
    "rust_shared_library",
    "rust_static_library",
    "rust_test",
)

rust_shared_library(
    name = "greeter_cdylib",
    srcs = [
        "greeter.rs",
        "shared_lib.rs",
    ],
    crate_root = "shared_lib.rs",
    edition = "2018",
)

rust_static_library(
    name = "greeter_staticlib",
    srcs = [
        "greeter.rs",
        "static_lib.rs",
    ],
    crate_root = "static_lib.rs",
    edition = "2018",
)

rust_test(
    name = "rust_project_json_test",
    srcs = ["rust_project_json_test.rs"],
    data = [":rust-project.json"],
    edition = "2018",
    env = {"RUST_PROJECT_JSON": "$(rootpath :rust-project.json)"},
    # This target is tagged as manual since it's not expected to pass in
    # contexts outside of `//test/rust_analyzer:rust_analyzer_test`. Run
    # that target to execute this test.
    tags = ["manual"],
)
